<template>
    <div>
 <!-- 搜索和添加栏 -->
  <div class="search-lan" id="search">
    <el-input v-model="input" placeholder="请输入内容"></el-input>
    <el-button type="primary" icon="el-icon-search">搜索</el-button>
    <!-- <el-button type="primary">添加</el-button> -->
  </div>
        <router-view/>
        <user-table :item="data"/>
                <el-footer>
        <el-pagination
    layout="prev, pager, next"
     :page-count="data.sumpage"
            @current-change="handleCurrentChange">
  </el-pagination>
        </el-footer>
    </div>
</template>

<script>
import UserTable from '@/components/UserTable.vue'
    export default {
      components: { UserTable },
      data() {
        return {
          input: '',
          data:'',
           page:'1',
        }
      },
      mounted(){
    
        this.getData()
      },
      methods: {
         handleCurrentChange(val) {
        console.log(`当前页: ${val}`);
        this.page=val
        console.log(this.page)
        this.getData()
      },
        getData() {
          const url = `/ht_fy?pageSize=5&&curpage=${this.page}`;
    this.axios.get(url).then((res) => {
      this.data = res.data;
      console.log(res);
          })
        }
      },
        
    }
</script>

<style lang="scss" scoped>
#search {
    display: flex;
    margin-bottom: 20px;
}
</style>